//
//  ShaiXuanViewController.m
//  ZhiBoYuan
//
//  Created by apple on 2018/4/18.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "ShaiXuanViewController.h"
#import "ShaiXuanCell.h"

#import "WSLWaterFlowLayout.h"



static NSString *ident = @"ShaiXuanCell";


static NSString *kindident = @"headView";

#import "UIButton+LZCategory.h"

#import "headView.h"

#import "Home.h"
#define JianGe 5
#define GeShu 3




@interface ShaiXuanViewController ()
<
UICollectionViewDelegate,
WSLWaterFlowLayoutDelegate,
UICollectionViewDataSource
>
{
    NSArray *name ;
    NSMutableArray *iamge ;
}

@property (weak, nonatomic) IBOutlet UIView *backView;
//@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;

@property (strong, nonatomic)  UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UIButton *resetButton;
@property (weak, nonatomic) IBOutlet UIButton *okButton;

/*  大数组  */
@property (nonatomic,strong)NSMutableArray *allArr;

/*  选择后的数组  */
@property (nonatomic,strong)NSMutableArray *rightLabelArray;


@property (nonatomic,strong)NSArray *headerNameArr;

@property (nonatomic,strong)UILabel *label;

/*  学段  */
@property (nonatomic,strong)NSMutableArray *xueDuanArr;

/*  学课  */
@property (nonatomic,strong)NSMutableArray *xueKeArr;

/*  年级  */
@property (nonatomic,strong)NSMutableArray *nianJiArr;
/*  知识点  */
@property (nonatomic,strong)NSMutableArray *zhiShiDianArr;
/*  分类  */
@property (nonatomic,strong)NSMutableArray *fenLeiArr;

/*  类型  */
@property (nonatomic,strong)NSMutableArray *leiXingnArr;

/*  是否重置  */
@property(nonatomic,assign)BOOL chongzhi;

/*  分区头点击事件  */
@property(nonatomic,strong)NSMutableArray * hidenArr;
/*  分区头右边图  */
@property(nonatomic,strong)NSMutableArray *headImageArr;
/*  分区头右边文字  */
@property(nonatomic,strong)NSMutableArray *headTittleArr;

@property(nonatomic,strong)WSLWaterFlowLayout * flow;



@end


@implementation ShaiXuanViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
//    self.layout.itemSize = CGSizeMake((ScreenWidth - JianGe*(GeShu+1)) / GeShu, 30);
//    self.layout.estimatedItemSize = CGSizeMake([[UIScreen mainScreen] bounds].size.width, 30);
    
    
    [self inintlabel];

    
    [self.backView addSubview:self.collectionView];
    self.collectionView.sd_layout
    .topSpaceToView(self.backView, 5)
    .bottomSpaceToView(self.backView, 5)
    .rightSpaceToView(self.backView, 0)
    .leftSpaceToView(self.backView, 0);
    [self.collectionView.mj_header beginRefreshing];
    
    BTN_MSG_FUNC(_okButton, okSender);
    BTN_MSG_FUNC(_resetButton, resetSender);
    
    
    

}

#pragma mark -----------------------  初始化默认图文  ------------------------
-(void)inintlabel{
    if (self.shaiXuan == ShaiXuanTypekeTask)
    {
        
        _headTittleArr =   @[@"",@"全部",@"全部",@"全部",@"",@""].mutableCopy;
        
        _headImageArr =   @[@"",@"箭头-4",@"箭头-4",@"箭头-4",@"",@""].mutableCopy;
        
    }
    else
    {
        _headTittleArr =   @[@"",@"全部",@"全部",@"全部",@""].mutableCopy;
        
        _headImageArr =   @[@"",@"箭头-4",@"箭头-4",@"箭头-4",@""].mutableCopy;
    }
    
    
    
    
    
    if (self.shaiXuan == ShaiXuanTypeXuanTi) // _xuanTi
    {
        // 习题筛选
        _headerNameArr = @[@"学段",@"学科",@"年级",@"知识点",@"难度"];
        
        for (int i = 0; i < _headerNameArr.count; i++)
        {
            [self.allArr addObject:@[].mutableCopy];
            [self.rightLabelArray addObject:@[].mutableCopy];
        }
        
        NSDictionary *dic =  @{@"name":@"基础题",@"id":@"1" };
        NSDictionary *dic2 = @{@"name":@"中档题",@"id":@"2" };
        NSDictionary *dic3 = @{@"name":@"难题",@"id":@"3" };
        NSArray *leiXing   = @[dic,dic2,dic3];
        [self.allArr replaceObjectAtIndex:4 withObject:leiXing];
        self.rightLabelArray[4] = [NSMutableArray arrayWithObject:self.allArr[4][0]];
        
    }
    else  if (self.shaiXuan == ShaiXuanTypeKeChengList)
    {
        // 展示列表的选课
        _headerNameArr = @[@"学段",@"学科",@"年级",@"知识点",@"类型"];
        for (int i = 0; i < _headerNameArr.count; i++)
        {
            [self.allArr addObject:@[].mutableCopy];
            [self.rightLabelArray addObject:@[].mutableCopy];
        }
        
        NSDictionary *dic =  @{@"name":@"免费",@"id":@"1" };
        NSDictionary *dic2 = @{@"name":@"套餐",@"id":@"2" };
        NSArray *leiXing = @[dic,dic2];
        [self.allArr replaceObjectAtIndex:4 withObject:leiXing];
        
        // 添加默认选中
        
        self.rightLabelArray[4] = [NSMutableArray arrayWithObject:self.allArr[4][0]];
    }
    else
    {
        
        // 任务里课程筛选
        _headerNameArr = @[@"学段",@"学科",@"年级",@"知识点",@"类型",@"分类"];
        for (int i = 0; i < _headerNameArr.count; i++)
        {
            [self.allArr addObject:@[].mutableCopy];
            [self.rightLabelArray addObject:@[].mutableCopy];
        }
        
        NSDictionary *dic =  @{@"name":@"免费",@"id":@"1" };
        NSDictionary *dic2 = @{@"name":@"套餐",@"id":@"2" };
        NSArray *leiXing = @[dic,dic2];
        [self.allArr replaceObjectAtIndex:4 withObject:leiXing];
        self.rightLabelArray[4] = [NSMutableArray arrayWithObject:leiXing[0]];
        
        NSDictionary *fdic =  @{@"name":@"直播",@"id":@"1" };
        NSDictionary *fdic2 = @{@"name":@"微课",@"id":@"2" };
        NSArray *fenlei = @[fdic,fdic2];
        [self.allArr replaceObjectAtIndex:5 withObject:fenlei];
        
        // 添加默认选中
        
        
        self.rightLabelArray[5] = [NSMutableArray arrayWithObject:fenlei[0]];
    }
    
    
    [self initFenQuTou];
    
}

#pragma mark ----------------------- 初始化分区头 ------------------------

-(void)initFenQuTou{
    // 分区头右侧自定义图文
    if (self.shaiXuan == ShaiXuanTypekeTask)
    {
        
        name =   @[@"",@"全部",@"全部",@"全部",@"",@""];
        
        iamge =   @[@"",@"箭头-4",@"箭头-4",@"箭头-4",@"",@""].mutableCopy;
        
    }
    else
    {
        name =   @[@"",@"全部",@"全部",@"全部",@""];
        
        iamge =   @[@"",@"箭头-4",@"箭头-4",@"箭头-4",@""].mutableCopy;
    }
    self.hidenArr = [NSMutableArray array];
    // 初始是否隐藏
    for (int i = 0; i < _headerNameArr.count; i++)
    {
        
        BOOL isShow = NO;
        NSString *aa = [NSString stringWithFormat:@"%d",isShow];
        [self.hidenArr addObject:aa];
    }
    
}

-(UICollectionView *)collectionView
{
    if (!_collectionView)
    {
        
//        UICollectionViewFlowLayout * layout = [[UICollectionViewFlowLayout alloc]init];
        
        
//        layout.estimatedItemSize = CGSizeMake((ScreenWidth - 30 - JianGe*(GeShu+1)) / GeShu, 30);
//        layout.itemSize  =  CGSizeMake((ScreenWidth - 30 - JianGe*(GeShu+1)) / GeShu, 30);
        
        
//        LMHWaterFallLayout * layout = [[LMHWaterFallLayout alloc]init];
//        layout.delegate = self;
        _flow = [[WSLWaterFlowLayout alloc] init];
        _flow.delegate = self;
        _flow.flowLayoutStyle = (WSLFlowLayoutStyle)0;
        
        _collectionView = [[UICollectionView alloc]initWithFrame:self.backView.bounds collectionViewLayout:_flow];
        
        
        // 创建布局
//        LMHWaterFallLayout * waterFallLayout = [[LMHWaterFallLayout alloc]init];
//        waterFallLayout.delegate = self;
        
        // 创建collectionView

        _collectionView.backgroundColor = [UIColor whiteColor];
        
        _collectionView.delegate = self;
        _collectionView.dataSource = self;
        
        [_collectionView registerNib:[UINib nibWithNibName:@"ShaiXuanCell" bundle:nil] forCellWithReuseIdentifier:ident];
        
        [_collectionView registerClass:[headView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kindident];
        
        __weak __typeof(&*self)weakSelf = self;
        
        _collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
            _chongzhi = YES;
            //        [weakSelf resetSender];
            [weakSelf allLoad];
        }];
        

    }
    return _collectionView;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
}


#pragma mark -----------------------获取学段------------------------
-(void)getXueDuan {
    

    SGParameter *parameter  = [[SGParameter alloc] init];

    NSString *lastUrl  = @"g=Client&m=Course&a=xueduanList";
    
    [SGHttpTool POST:[NSString stringWithFormat:@"%@%@",HTTPP,lastUrl] parameter:parameter sucess:^(id responseObject) {

        NSDictionary *dic = responseObject;
        NSMutableArray *arr = dic[@"data"][@"xueduan_list"];
        if (arr.count > 0)
        {
            [self.allArr replaceObjectAtIndex:0 withObject:arr];
            
            self.rightLabelArray[0] = [NSMutableArray arrayWithObject:_allArr[0][0]];

        }
          [self.collectionView reloadData];


    } failure:^(NSError *error) {
        NSLog(@"%@",error);
        
    }];
    
}

#pragma mark -----------------------获取学科------------------------
-(void)getXueKe {
    
    SGParameter *parameter  = [[SGParameter alloc] init];
    NSString *lastUrl  = @"g=Client&m=Course&a=xuekeList";
    
    [SGHttpTool POST:[NSString stringWithFormat:@"%@%@",HTTPP,lastUrl] parameter:parameter sucess:^(id responseObject) {
        
        NSDictionary *dic = responseObject;

        NSMutableArray *arr = dic[@"data"][@"xueke_list"];
        
        if (arr.count > 0)
        {
            [self.allArr replaceObjectAtIndex:1 withObject:arr];
            self.rightLabelArray[1] = [NSMutableArray arrayWithObject:_allArr[1][0]];
            
        }
        [self.collectionView reloadData];
        

        
    } failure:^(NSError *error) {
        NSLog(@"%@",error);
        
    }];
    
}



#pragma mark -----------------------获取年级------------------------
-(void)getNianJi {
    
    SGParameter *parameter  = [[SGParameter alloc] init];
    NSString *lastUrl  = @"g=Client&m=Course&a=nianjiList"; // g=Client&m=Teacher&a=getGradeList //
    
    [SGHttpTool POST:[NSString stringWithFormat:@"%@%@",HTTPP,lastUrl] parameter:parameter sucess:^(id responseObject) {

        NSDictionary *dic = responseObject;
        
        NSMutableArray *arr = dic[@"data"][@"nianji_list"];
        
        if (arr.count > 0)
        {
            [self.allArr replaceObjectAtIndex:2 withObject:arr];
            self.rightLabelArray[2] = [NSMutableArray arrayWithObject:self.allArr[2][0]];
           
        }
        [self.collectionView reloadData];


        
    } failure:^(NSError *error) {
        NSLog(@"%@",error);
        
    }];
    
}

#pragma mark -----------------------获取知识点------------------------
-(void)getZhiShiDian {
    
     NSLog(@"获取知识点 = %@",self.rightLabelArray);
    [self.collectionView.mj_header endRefreshing];
    
    if (((NSMutableArray *)self.rightLabelArray[0]).count >0 &&
        ((NSMutableArray *)self.rightLabelArray[1]).count >0 &&
        ((NSMutableArray *)self.rightLabelArray[2]).count >0 )
    {

    }
    else
    {
        
        [self.collectionView.mj_header beginRefreshing];
        return;
    }
    

    NSDictionary *dic0 = self.rightLabelArray[0][0];
    NSString *xueduan_id = [dic0 valueForKey:@"id"];
    
    
    NSDictionary *dic1 = self.rightLabelArray[1][0];
    NSString *xueke_id   = [dic1 valueForKey:@"id"];
    
    NSDictionary *dic2 = self.rightLabelArray[2][0];
    NSString *nianji_id  =[dic2 valueForKey:@"id"];
    
    
    
     SGParameter *parameter  = [[SGParameter alloc] init];
    
    
    parameter.body = @{@"xueduan_id":xueduan_id,
                       @"xueke_id":xueke_id,
                       @"nianji_id":nianji_id,
                       };
    NSLog(@"parameter.body  = %@",parameter.body );

    
    
    
    NSString *lastUrl  = @"g=Client&m=Course&a=knowledgeList";
    
    [SGHttpTool POST:[NSString stringWithFormat:@"%@%@",HTTPP,lastUrl] parameter:parameter sucess:^(id responseObject) {
        
        
        
        NSDictionary *dic = responseObject;
        NSLog(@"knowledge_point_list = %@",dic);
        NSMutableArray *arr = dic[@"data"][@"knowledge_point_list"];

        NSLog(@"%@",arr);
        if (arr.count > 0)
        {
            [self.allArr replaceObjectAtIndex:3 withObject:arr];
        }
        else
        {
            [self.allArr replaceObjectAtIndex:3 withObject:@[].mutableCopy];
        }
        NSArray *arrcotn = self.allArr[3];

        if (arrcotn.count > 0) {
             self.rightLabelArray[3] = [NSMutableArray arrayWithObject:self.allArr[3][0]];
        }
        
        if (_chongzhi) {
            if (self.shaiXuan == ShaiXuanTypeXuanTi || self.shaiXuan == ShaiXuanTypeKeChengList)
            {
                
                self.rightLabelArray[4] = [NSMutableArray arrayWithObject:self.allArr[4][0]];
            }
            else
            {
                self.rightLabelArray[4] = [NSMutableArray arrayWithObject:self.allArr[4][0]];
                
                self.rightLabelArray[5] = [NSMutableArray arrayWithObject:self.allArr[5][0]];
            }
        }

        
        [self.collectionView reloadData];
        [self.collectionView.mj_header endRefreshing];
        
    } failure:^(NSError *error) {
        NSLog(@"%@",error);
        
    }];
    
}



#pragma mark -----------------------确认------------------------
-(void)okSender
{

    
    if (self.shaiXuanDic) {
        
            NSMutableArray *keyArr=[NSMutableArray array];
            NSMutableDictionary *dic =[NSMutableDictionary dictionary];
        
            if (self.shaiXuan == ShaiXuanTypeKeChengList || self.shaiXuan == ShaiXuanTypeXuanTi) {
                keyArr = @[@"xueDuan",@"xueKe",@"nianJi",@"zhiShiDian",@"leiXing"].mutableCopy;
        
            }else{
                keyArr = @[@"xueDuan",@"xueKe",@"nianJi",@"zhiShiDian",@"leiXing",@"fenlei"].mutableCopy;
            }
        //      NSLog(@"%zd   =====  %zd",self.rightLabelArray.count,keyArr.count);
        
            for (int i = 0; i<keyArr.count;i++) {
        
                NSArray *arr = self.rightLabelArray[i];
                NSString *st = keyArr[i];
                [dic setValue:arr forKey:st];
        
            }
        
        
//            NSLog(@"%@",dic);
        
        
        self.shaiXuanDic(dic);

    }
    
    [self dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark ----------------------- 重置 ------------------------
- (void)resetSender
{

    _chongzhi = YES;
    [self allLoad];
}

-(void)allLoad{
    [self initFenQuTou];
    
    
    __weak __typeof(&*self)weakSelf = self;
    
    
    dispatch_queue_t queue =dispatch_queue_create("serial",DISPATCH_QUEUE_SERIAL);
    
    dispatch_sync(queue, ^{
        
        NSLog(@"1111111111111111111111");
        [weakSelf getXueDuan];
        
    });
    
    dispatch_sync(queue, ^{
        NSLog(@"111111111112222222");
        
        [weakSelf getXueKe];
    });
    
    dispatch_sync(queue, ^{
        NSLog(@"111111111113333333");
        [weakSelf getNianJi];
        
    });
    
    dispatch_sync(queue, ^{
        NSLog(@"11111111111444444444");
        
        //        [weakSelf getZhiShiDian];
        [weakSelf performSelector:@selector(getZhiShiDian) withObject:nil afterDelay:1];
        
    });
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self dismissViewControllerAnimated:YES completion:^{

    }];
}

//#pragma mark - 头部视图大小 //第二步
//- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
//{
//    CGSize size = CGSizeMake(ScreenWidth, 30);
//    return size;
//
//}

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{

    if (kind == UICollectionElementKindSectionHeader)
    {
        
        headView *headcell = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:kindident forIndexPath:indexPath];

        [headcell.button setTitle:name[indexPath.section] forState:0];
        
        [headcell.button setImage:[UIImage imageNamed:iamge[indexPath.section]] forState:0];

        
        [headcell setHearderTitle:_headerNameArr[indexPath.section]];
        
        BTN_MSG_FUNC(headcell.button, allOrHidenSender:);
        
        headcell.button.tag = indexPath.section;
        
        return headcell;
        
    }
    else
    {
        return nil;
    }
}


#pragma mark -----------------------  分区头点击事件  ------------------------
-(void)allOrHidenSender:(UIButton *)sender
{
    //    sender.backgroundColor = [UIColor redColor];
    
    if (sender.tag == 1||  sender.tag == 2|| sender.tag == 3)
    {
        NSString *str = ({
            self.hidenArr[sender.tag];
        });
        
        BOOL isHiden = [str isEqualToString:@"0"] ? NO : YES;
        
        isHiden = !isHiden;
        
        
        NSString *aa = [NSString stringWithFormat:@"%d",isHiden];
        [self.hidenArr setObject:aa atIndexedSubscript:sender.tag];
        
        if (isHiden)
        {
            [iamge replaceObjectAtIndex:sender.tag withObject:@"箭头-5"];
        }
        else
        {
            [iamge replaceObjectAtIndex:sender.tag withObject:@"箭头-4"];
        }
        
        [self.collectionView reloadData];
    }
   
}

-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
    return _allArr.count;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    NSString *str = ({
        self.hidenArr[section];
    });
    
    NSArray *arr = ({
        _allArr[section];
    });
    
    
    BOOL isHiden = [str isEqualToString:@"0"] ? NO : YES;
    
    if (isHiden)
    {
        return 0;
    }
    else
    {
        return arr.count;
    }
}

#pragma mark ----------------------- cell 点击------------------------

- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    
    ShaiXuanCell *cell =[collectionView dequeueReusableCellWithReuseIdentifier:ident forIndexPath:indexPath];
    NSArray *arrname = _allArr[indexPath.section];
    Home *h = [[Home alloc]initWithDictionary:arrname[indexPath.row]];
    cell.nameLabel.text = h.name;
    NSMutableArray *arr = _rightLabelArray[indexPath.section];
    NSString *str = _allArr[indexPath.section][indexPath.row];
    
    
    
//    NNSLog(@"sdfsfsfs==%zd== %@ =",indexPath.row,self.rightLabelArray);
    
    if ([ arr containsObject: str ])
    {
        cell.nameLabel.textColor = [UIColor whiteColor];
        cell.backgroundColor = ZhuTiColor;
    }
    else
    {
        cell.nameLabel.textColor = [UIColor blackColor];
        cell.backgroundColor = hui1Color;
    }
    return cell;
}


//UICollectionView被选中时调用的方法
- ( void )collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    
//    NSLog(@"%zd 区= %zd列",indexPath.section,indexPath.row);

//    NSLog(@"%@",_rightLabelArray);

    if (indexPath.section == 3 )
    {
        // 知识点多选
//        NSMutableArray *yuanArr =_allArr[indexPath.section];
//        NSLog(@"%@ 比较 %@",_rightLabelArray[indexPath.section],yuanArr[indexPath.row]);
//        if ([_rightLabelArray[indexPath.section] containsObject:yuanArr[indexPath.row]])
//        {
//            [_rightLabelArray[indexPath.section] removeObject:yuanArr[indexPath.row]];
//
//        }
//        else
//        {
//            [_rightLabelArray[indexPath.section] addObject:yuanArr[indexPath.row]];
//        }
        
        // 知识点单选
        
        _rightLabelArray[indexPath.section] =
        [NSMutableArray arrayWithObject:_allArr[indexPath.section][indexPath.row]];

        [collectionView reloadData];
    }
    else if ( indexPath.section == 4 || indexPath.section == 5 )
    {
        NSMutableArray *yuanArr =_allArr[indexPath.section];
        NSLog(@"%@ 比较 %@",_rightLabelArray[indexPath.section],yuanArr[indexPath.row]);


        if ([_rightLabelArray[indexPath.section] containsObject:yuanArr[indexPath.row]])
        {
            [_rightLabelArray[indexPath.section] removeObject:yuanArr[indexPath.row]];

        }
        else
        {
            _rightLabelArray[indexPath.section] =
            [NSMutableArray arrayWithObject:_allArr[indexPath.section][indexPath.row]];

        }
        [collectionView reloadData];
    }
    else
    {
        _rightLabelArray[indexPath.section] =
        [NSMutableArray arrayWithObject:_allArr[indexPath.section][indexPath.row]];
        _chongzhi = NO;
       [self getZhiShiDian];
    }
    

 
}


#pragma mark - WSLWaterFlowLayoutDelegate

-(CGFloat)waterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout heightForItemAtIndexPath:(NSIndexPath *)indexPath itemWidth:(CGFloat)itemWidth
{
    NSArray *arrname = self.allArr[indexPath.section];
    Home *h = [[Home alloc]initWithDictionary:arrname[indexPath.row]];
    return  h.cellHeight;

}

////头视图Size
-(CGSize )waterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout sizeForHeaderViewInSection:(NSInteger)section
{
    return  CGSizeMake(ScreenWidth, 30);
}

/** 列数*/
-(CGFloat)columnCountInWaterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout{
    return 3;
}



-(NSMutableArray *)xueDuanArr{
    if (!_xueDuanArr) {
        _xueDuanArr = [NSMutableArray array];
    }
    return _xueDuanArr;
}

-(NSMutableArray *)xueKeArr{
    if (!_xueKeArr) {
        _xueKeArr = [NSMutableArray array];
    }
    return _xueKeArr;
}

-(NSMutableArray *)nianJiArr{
    if (!_nianJiArr) {
        _nianJiArr = [NSMutableArray array];
    }
    return _nianJiArr;
}

-(NSMutableArray *)zhiShiDianArr{
    if (!_zhiShiDianArr) {
        _zhiShiDianArr = [NSMutableArray array];
    }
    return _zhiShiDianArr;
}


-(NSMutableArray *)allArr{
    if (!_allArr) {
        _allArr = [NSMutableArray array];
    }
    return _allArr;
}

-(NSMutableArray *)fenLeiArr{
    if (!_fenLeiArr) {
        _fenLeiArr = [NSMutableArray array];
    }
    return _fenLeiArr;
}

-(NSMutableArray *)leiXingnArr{
    if (!_leiXingnArr) {
        _leiXingnArr = [NSMutableArray array];
        
    }
    return _leiXingnArr;
}

-(NSMutableArray *)rightLabelArray{
    if (!_rightLabelArray) {
        _rightLabelArray = [NSMutableArray array];
    }
    return  _rightLabelArray;
}

-(NSMutableArray *)hidenArr{
    if (!_hidenArr) {
        _hidenArr = [NSMutableArray array];
    }
    return _hidenArr;
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
